package com.buobao.spring;

import com.buobao.spring.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;


public class SpringApplication {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(Config.class);

        Arrays.stream(context.getBeanDefinitionNames()).forEach(s->System.out.println(s));

        UserService userService = context.getBean(UserService.class);
        userService.getUserDao().query();
        userService.getEmployeeDao().query();
    }
}
